package org.lvgo.filter;

import java.util.List;
import java.util.stream.Collectors;

/**
 * 男性过滤器,只要男性
 *
 * @author lvgo
 * @version 1.0
 * @date 2018/9/21 0021 16:59
 */
public class MaleFilter implements Criteria {
    @Override
    public List<Person> filterPerson(List<Person> people) {
        // 只要集合中性别是Male的对象
        return people.stream().filter(person -> person.getGender().equals(Gender.Male)).collect(Collectors.toList());
    }
}
